// pages/my-nav-bar/index.js
let projects = []
for (let index = 0; index < 3; index++) {
  const item = {
    id: index + 1, 
    image: 'https://picsum.photos/200/300', 
    title: '【含做前卸甲】半贴+罐装光疗建构+款式含做前卸甲半贴+罐装光疗建构+款式+', 
    price: '100', 
    saleNum: '10',
    duration: '60分钟',
    canReservation: index % 2 === 0 ? true : false,
    checked: index % 2 === 0 ? true : false
  }
  projects.push(item)
}

Page({

  /**
   * 页面的初始数据
   */
  data: {
    title:[
      {itemTitle:'全部',type:''},
      {itemTitle:'待付款',type: 0},
      {itemTitle:'待发货',type: 1},
      {itemTitle:'待收货',type: 2},
      {itemTitle:'评价',type: 3},
      {itemTitle:'售后',type: 6},
      {itemTitle:'其他',type: 7},
    ],
    currentIndex: 0,
    container: '全部',

    tabs:[
      {title:'美甲',type:'', projects},
      {title:'美睫',type: 0, projects},
      {title:'护肤',type: 1, projects},
      {title:'美瞳',type: 2, projects},
      // {title:'美甲',type:'', projects},
      // {title:'美睫',type: 0, projects},
      // {title:'护肤',type: 1, projects},
      // {title:'美瞳',type: 2, projects},
    ],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    wx.setNavigationBarTitle({
      title: options.name,
    })
  },

  /**点击锚点跳转*/
  jumpTo(e) {
    const { title } = this.data
    let activeIndex = e.detail.index
    this.setData({
      currentIndex: activeIndex,
      container: title[activeIndex].itemTitle
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})